package com.ruoyi.project.stop.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.stop.domain.AppVersion;
import com.ruoyi.project.stop.mapper.AppVersionMapper;
import com.ruoyi.project.stop.service.IAppVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.text.Convert;

/**
 * app版本发布Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-08
 */
@Service
public class AppVersionServiceImpl implements IAppVersionService
{
    @Autowired
    private AppVersionMapper appVersionMapper;

    /**
     * 查询app版本发布
     *
     * @param id app版本发布主键
     * @return app版本发布
     */
    @Override
    public AppVersion selectAppVersionById(Long id)
    {
        return appVersionMapper.selectAppVersionById(id);
    }

    /**
     * 查询app版本发布列表
     *
     * @param appVersion app版本发布
     * @return app版本发布
     */
    @Override
    public List<AppVersion> selectAppVersionList(AppVersion appVersion)
    {
        return appVersionMapper.selectAppVersionList(appVersion);
    }

    /**
     * 新增app版本发布
     *
     * @param appVersion app版本发布
     * @return 结果
     */
    @Override
    public int insertAppVersion(AppVersion appVersion)
    {
        appVersion.setCreateTime(DateUtils.getNowDate());
        return appVersionMapper.insertAppVersion(appVersion);
    }

    /**
     * 修改app版本发布
     *
     * @param appVersion app版本发布
     * @return 结果
     */
    @Override
    public int updateAppVersion(AppVersion appVersion)
    {
        appVersion.setUpdateTime(DateUtils.getNowDate());
        return appVersionMapper.updateAppVersion(appVersion);
    }

    /**
     * 批量删除app版本发布
     *
     * @param ids 需要删除的app版本发布主键
     * @return 结果
     */
    @Override
    public int deleteAppVersionByIds(String ids)
    {
        return appVersionMapper.deleteAppVersionByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除app版本发布信息
     *
     * @param id app版本发布主键
     * @return 结果
     */
    @Override
    public int deleteAppVersionById(Long id)
    {
        return appVersionMapper.deleteAppVersionById(id);
    }
}
